

function [Ucorr] = cross_variables(U , V)

N = size( V );

M =  length( U );
MM = size( U{1} );

U = cell2mat(U);
U = reshape( U , [ MM(1) , MM(2) , M ] );

Ucorr = cell(1 , N(1));


for k = 1 : N(1)
    
    for m = 1 : N(2)

        if m ~= 1 && m < N(2)
            uv = cat(3 , uv , V(k , m) * U);
        elseif m == N(2)
            uv = cat(3 , uv , V(k , m) * U);
            Ucorr{k} = uv;
        else
            uv = V(k , m) * U;
        end

    end
    
end

end